package jsyf.oa.entity.device;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by y on 2018/8/17.
 */
@Entity
@Table(name = "T_DVC_PARTS_RECORDS", schema = "oa", catalog = "")
public class DevicePartsEntity extends BaseEntity {
    private String sampleId;
    private String partsName;
    private String partsPrice;

    public String getSampleId() {
        return sampleId;
    }

    public void setSampleId(String sampleId) {
        this.sampleId = sampleId;
    }

    public String getPartsName() {
        return partsName;
    }

    public void setPartsName(String partsName) {
        this.partsName = partsName;
    }

    public String getPartsPrice() {
        return partsPrice;
    }

    public void setPartsPrice(String partsPrice) {
        this.partsPrice = partsPrice;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("SAMPLE_ID",this.getSampleId());
        obj.put("PARTS_NAME", this.getPartsName());
        obj.put("PARTS_PRICE", this.getPartsPrice());
        obj.put("UPDATE_USER_ID", getUpdateUserId());
        obj.put("UPDATE_TIME", getUpdateTime());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_DVC_PARTS_RECORDS";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("SAMPLE_ID","sampleId");
        obj.put("PARTS_NAME", "partsName");
        obj.put("PARTS_PRICE", "partsPrice");
        obj.put("UPDATE_USER_ID", "updateUserId");
        obj.put("UPDATE_TIME", "updateTime");
        return obj;
    }
}
